<h2 translate>Upgrade</h2>

<label translate>Upgrade system:</label>
<p translate>Upload a sysupgrade-compatible image here to replace the running firmware. Check "Keep settings" to retain the current configuration</p>
<div class="panel panel-default panel-body text-left">
	<div class="checkbox">
		<label translate>Keep settings</label>
		<input type="checkbox" ng-model="View.keep">
	</div>
	<label class="btn btn-primary" for="file" translate>Browse</label>
	<input id="file" type="file" style="display:none;" file-model="View.myFile"></input>
	<button class="btn btn-success" ng-disabled="!View.uploadFileSelected()" ng-click="View.uploadUpgrade(View.keep)" translate>Upload upgrade</button>
	<input value="{{ View.getSelectedFileName() }}" disabled></input>
</div>

<script type="text/ng-template" id="system/backup/success.html">
	<div class="modal-header">
		<h4 translate>Upgrade system</h4>
	</div>
	<div class="modal-body">
		<div class="alert alert-info" role="alert">
			<p translate> Size {{size}} </p>
			<p translate> Checksum {{checksum}} </p>
		</div>
		<div class="alert alert-danger" role="alert">
			<p class="text-center" translate>System will be rebooted after upgrade</p>
		</div>
	</div>
	<div class="modal-footer">
		<button class="btn btn-danger" translate ng-click="success.cancel()">Cancel</button>
		<button class="btn btn-success" translate ng-click="success.upgrade()">Apply</button>
	</div>
</script>

<script type="text/ng-template" id="system/backup/failed.html">
	<div class="modal-header">
		<h4 translate>Upgrade system</h4>
	</div>
	<div class="modal-body">
		<div class="alert alert-danger" role="alert">
			<p translate> ErrorCode: {{code}} </p>
			<p translate> Stdout {{stdout}} </p>
		</div>
	</div>
	<div class="modal-footer">
		<button class="btn btn-success" ng-click="failed.confirm()" translate>Confirm</button>
	</div>
</script>

